package top.maof.book.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import top.maof.book.model.Book;

import java.util.List;
import java.util.Map;

@Mapper
public interface BookMapper extends BaseMapper<Book> {
    int deleteByPrimaryKey(Integer id);

//    int insert(Book record);

    int insertSelective(Book record);

    Book selectByPrimaryKey(Integer id);

    @Select("select * from book where name = #{name} and author = #{author}")
    Book selectByNameAndAuthor(String name, String author);

    @Select("select * from book where  author = #{author}")
    List<Book> selectByAuthor(String author);

    int updateByPrimaryKeySelective(Book record);

    int updateByPrimaryKeyWithBLOBs(Book record);

    int updateByPrimaryKey(Book record);

    List<Book> select(Map map);

    int selectCount(Map map);

    // 按id批量查询
    List<Book> selectList(List list);

}
